﻿<UserControl x:Class="SLExtensions.Showcase.PageSwappableContent"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 xmlns:slec="clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"
    xmlns:ext="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:controllers="clr-namespace:SLExtensions.Showcase.Controllers"
    >
    <UserControl.Resources>
        <controllers:PageSwappableContentController x:Name="controller"    />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <StackPanel>
            <ListBox ItemsSource="{Binding Data, Source={StaticResource controller}}" SelectedItem="{Binding SelectedData, Mode=TwoWay, Source={StaticResource controller}}">

            </ListBox>
        </StackPanel>
        <slec:SwappableContentControl Content="{Binding SelectedData, Source={StaticResource controller}}">
            <slec:SwappableContentControl.ContentTemplate>
                <DataTemplate>
                    <Grid Width="100" Height="100" Background="{Binding Color}">
                        <TextBlock Text="{Binding Name}" />
                    </Grid>
                </DataTemplate>
            </slec:SwappableContentControl.ContentTemplate>
        </slec:SwappableContentControl>
    </Grid>
</UserControl>
